const Koa = require('koa2')
const cros = require('koa2-cors')
const static = require('koa-static')
const path = require('path')

const app = new Koa()
const port = '5555'

const router = require('./router/index')

app.use(static(path.join(__dirname, './assets')))
app.use(cros())
app.use(router.routes(), router.allowedMethods())

app.listen(port, () => {
  console.log(`Port:${port}`)
})
